mejia_david
mejia_david

Reputation: 317

QLIK 101: I have a data/field with format DD/MM/YYYY. Need to creat bar chart with age range

First time I am using qlik sense. None of the videos that I have watch have help me so far.

I have data/field name 'inscription' with date format dd/mm/yyyy. I need to set age range from 18y to 90y, in range of 10y. For example from 18-28, 28-38...

I have no idea how to do this. I need the formula to do it and also where do I put this formula (its my first time using this tool). Do I create a new dimension on the left side of the app under custom objects? Do I put the formula in the right side where I set the dimension(bars) and measures(height)? or under aperance?

I am using qlik sense desktop feb 2019. 13.9.1

Upvotes: 1

Views: 792

Answers (1)

Hubert Dudek
Hubert Dudek

Reputation: 1722

Hi I don't see your data so: 1) be sure that your date field is implemented as date by qlikview (you can test it in model viewer) if not please load it as date in load script and you can also calculate current age:

LOAD
  (...)
  Date#(inscription,'DD/MM/YYY') as inscription,
  Today() - Date#(inscription,'DD/MM/YYY') as age // you can add Floor() or Round() function to load it as integer
  (...)

Next in sheet please add histogram to display age in buckets. One way is to set dimension manually (it is like this in QlikView):

class( age, 10 )

In QlikSense is easier just drag and drop "histogram" from left, choose "age" as dimensions and customize it: see here https://www.youtube.com/watch?v=p97tIzZeZeQ

If you still have problems please let me know so I will update post. You can share also more data - model viewer screenshot, loading script or even whole qvf file from QlikSense. There are also other ways to achieve that but it depends on your data. Generally fastest is to calculate age in loading script as in above example.

Upvotes: 1

Related Questions