Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis

Hi all , need help , i have a set analysis like this:

=count({$<Date={ ">=$(=Date((Today()-30), 'YYYY.MM.DD')) <=$(=Date((Today()-0), 'YYYY.MM.DD'))" },OfferingCategory1={Narystės}>} DISTINCT SabID)

and i need to iplement If statment into set analysis, like this : {$<Abonement.End={ ">=$(=Date((Today()-60), 'YYYY.MM.DD')) <=$(=Date((Today()-30), 'YYYY.MM.DD'))" }>}

the logic is:

if {$<Abonement.End={ ">=$(=Date((Today()-60), 'YYYY.MM.DD')) <=$(=Date((Today()-30), 'YYYY.MM.DD'))" }>}

then

count({$<Date={ ">=$(=Date((Today()-30), 'YYYY.MM.DD')) <=$(=Date((Today()-0), 'YYYY.MM.DD'))" },OfferingCategory1={Narystės}>} DISTINCT SabID)

please help

4 Replies
nilesh_gangurde
Partner - Specialist
Partner - Specialist


Hi,

you can include the if expression in your count.

For example. you can use the below mentioned expression.

count({$< Abonement.End={ ">=$(=Date((Today()-60), 'YYYY.MM.DD')) <=$(=Date((Today()-30), 'YYYY.MM.DD'))" }

          ,Date={ ">=$(=Date((Today()-30), 'YYYY.MM.DD')) <=$(=Date((Today()-0), 'YYYY.MM.DD'))" },OfferingCategory1={Narystės}>} DISTINCT SabID)

-Nilesh

Not applicable
Author

im not quite sure what your question is or what you want but try this:

if({$<Abonement.End={ ">=$(=Date((Today()-60), 'YYYY.MM.DD')) <=$(=Date((Today()-30), 'YYYY.MM.DD'))" }>},if({$<Date={ ">=$(=Date((Today()-30), 'YYYY.MM.DD')) <=$(=Date((Today()-0), 'YYYY.MM.DD'))" },OfferingCategory1={Narystės}>}, count(DISTINCT SabID)))

Not applicable
Author

i need count all records where:

{$<Abonement.End={ ">=$(=Date((Today()-60), 'YYYY.MM.DD')) <=$(=Date((Today()-30), 'YYYY.MM.DD'))" }>}

in this set analysis :count({$<Date={ ">=$(=Date((Today()-30), 'YYYY.MM.DD')) <=$(=Date((Today()-0), 'YYYY.MM.DD'))" },OfferingCategory1={Narystės}>} DISTINCT SabID)

Nilesh, yours solution is working, but returns only 2 records, there must be more...

er_mohit
Master II
Master II

try this

if(num(Abonement.End)>=num(Date((Today()-60)) and num(Abonement.End)<= num(Date(Today()-30)),

count({< Date={ ">=$(=Date((Today()-30), 'YYYY.MM.DD')) <=$(=Date((Today()), 'YYYY.MM.DD'))" }

,OfferingCategory1={Narystės}>} DISTINCT SabID)