Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
Request help in nested if for a qlik logic I have.
I have 3 tables loaded , each table has a type of device in it.
I want to take a count of device in each table divided by total count of devices from all 3 tables, including few other where clauses.
A:
id
deviceA
date
calculated measure
date
B:
id
deviceB
date
calculated measure
date
C:
id
deviceC
date
calculated measure
date
how can I get below output?
I want output like
if date <today()) count(date) (individual device count A/B/C) count(ID)3 tables (individual device count) /count(ID)
regards,
Sahana
Hi @hosasahana , please see if this works for you and if it is what you want theorically, it is always preferible to make things on script, before trying to do everything in expressions.
It is a concatenation of that three tables :
A:
Load
id,
deviceA as Device,
DateField,
CalculatedMeasure
From yoursource;
concatenate
Load
id,
deviceB as Device,
DateField,
CalculatedMeasure
From yoursource;
concatenate
Load
id,
deviceC as Device,
DateField,
CalculatedMeasure
From yoursource;
Then, makes 2 tables to get the results about dates :
Not_Today:
Load
Device,
count(date) as Not_Today_Count
from A
Where
DateField < today()
Group By
Device;
Today:
Load
Device,
count(date) as Today_Count
from A
Where
DateField >= today()
Group By
Device;
then you can make a formula like this in your chart, using Device as dimension:
sum(Not_Today_Count) / sum ( total Today_Count)