Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
neha_sri
Creator III
Creator III

Showing incorrect data while applying set analysis

Hi,

I have created a data model linked with calender.Now I have added one more table that also contains date field and I don't want to link that date field with calender,but in front end I want to show data based on calender year,month selection.So i have tried below mentioned set analysis

=count({<[Code]={'M'},Year=p([Restore Year]),Month=p([Restore Month]),Year=,Month=>}[WO ID])

where Year and Month are my calender year and month and

Restore Year and [Restore Month] are created from my new table date

The above expression is not showing the correct data.

Please help me out.Thanks in anticipation

6 Replies
danielblank
Partner - Contributor III
Partner - Contributor III

Have you validated the month value? Are Month and Restore Month in the same format?

Maybe they are numeric and alphabetic, like 3 and Mar...?

In this case, you should create an addition field like MonthNum and RestoreMonthNum in the script.

Kind regards,

Daniel

neha_sri
Creator III
Creator III
Author

The format for month and restore month are same

danielblank
Partner - Contributor III
Partner - Contributor III

numeric?

danielblank
Partner - Contributor III
Partner - Contributor III

Another thing that caught my eye: the syntax of the p()... it should be like this:

Count({$<Year={[Restore year]}, Month={[Restore Month]}>} [WO ID])

Using P() in Set Analysis would require another syntax, like

Count({$<CustomerID=P({1<Product={'Shoe'}>})>} CustomerID)

Not applicable

try this:

=count({<[Code]={'M'},Year=P([Restore Year] = Year),Month=P([Restore Month] = Month),Year=,Month=>}[WO ID])

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

=count({<[Code]={'M'},Year=P([Restore Year]),Month=P([Restore Month])>}[WO ID])


Regards,

Jagan.