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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikeers
Creator II
Creator II

Show column if - condition for a simple table

Hi! We have three automatically linked tables - sales, calendar and customer.

Sales
%Date
%CustNo
OrderNo
Qty

Value

 

Calendar
%Date
Day
Month (type: string)
Year

 

Customer
%CustNo
CustName
Division
State
Address
E-Mail

 

We create a sheet with a simple table.

1. Dimmension - State

2. Measure1 - {<Month = {"2023/06"}>} sum([Value])

3. Measure2 - {<Month = {"2023/05"}>} sum([Value])

4. Measure3 - {<Month = {"2023/04"}>} sum([Value])

...

I would like to have "month" in the filter panel. How to write an expression in "show column if" to show only those columns that are selected in the filter?

Labels (4)
4 Replies
udit_k
Partner - Creator II
Partner - Creator II

Hi , You could use below expression in Measure Show Column  if Condition of straight table

=if(GetFieldSelections(CalendarMonthYear)='May-23',1,0)

qlikeers
Creator II
Creator II
Author

I know such a solution, I mean a universal way.
I select in the filter, e.g. 2023/06 and 2023/01, only these columns are shown. I mark 2022/03 - only this one is shown. E.t.c.

udit_k
Partner - Creator II
Partner - Creator II

Hi , We could use below universal expression  in Show Column  if Condition of straight table

=if(wildmatch(concat(distinct CalendarMonthYear, ','),'*May-23*'),1,0)

qlikeers
Creator II
Creator II
Author

I tried something like this, but it might actually work. I will try, thank you!