Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GetFieldSelections Pivot Table

Hi Guys

I have a Pivot Table where the demension is [Mat Date], I wish to load only the data where the [Mat Date] is Greater than or equal to today.

I have tried to use calculated condition

GetFieldSelections([Mat Date],>=today())

But this has no change

Can anyone help please ?

Thanks

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

I'd rather use the condition in every expression within that chart using set analysis. Calculated dimensions perform really poor with a few dozens of thousands of records, whilst set analysis performs noticeably faster:

Sum({< [Mat Date] = {">=$(=Today())"} >} Sales)

I know that it takes a little bit more of coding, but it's worth spending your time here that the chart rendering slower for the user.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

9 Replies
swuehl
MVP
MVP

Why do you want to call GetFieldSelections()? I may misunderstood your question, but try a simple

=if([Mat Date]>=today(),[Mat Date])

as calculated dimension and suppress NULL.

Hope this helps,

Stefan

its_anandrjs

Hi,

Use some thing lke this in the code slighltly change.

=GetFieldSelections( [Mat Date] ) >= Today()

Rgds

Anand

Miguel_Angel_Baeyens

Hi,

I'd rather use the condition in every expression within that chart using set analysis. Calculated dimensions perform really poor with a few dozens of thousands of records, whilst set analysis performs noticeably faster:

Sum({< [Mat Date] = {">=$(=Today())"} >} Sales)

I know that it takes a little bit more of coding, but it's worth spending your time here that the chart rendering slower for the user.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

SunilChauhan
Champion
Champion

code like below in back end

Load

field 1,

field 2,

.....,

[Mat Date]

from path

where [Mat Date]>=Today();

Sunil Chauhan
its_anandrjs

Hi,

1. If you are selecting any date values from any list box then use

   GetFieldSelections( [Mat Date] ) >= Today( ) it works good

2. If you want to filter out the pivot table completely with the today( ) date

   so use

   If( [Mat Date] >= Today(), [Mat Date] ) in Dimension

HTH

Rgds

Anand

Not applicable
Author

Hi Guys

Similiar issue I have a Crosstable load with a field as WorkStatus, I wish to only load where the WorkStatus is NOT Weekend,

I have tried this on a table box as

GetFieldSelections( WorkStatus )<> 'Weekend'

But its not working , can anyone help me please ?

Thanks

Miguel_Angel_Baeyens

Hi,

Do you mean a CROSSTABLE LOAD in your script? Then you cannot refer to field selections, they do not exist in your script yet, but you can use a WHERE clause

CROSSTABLE (Month, Value) LOAD ID,

     Jan,

     Feb,

     Mar

FROM File.qvd (qvd)

WHERE WorkStatus <> 'WeekEnd';

Is that what you mean?

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hi Miguel,

It is a Crosstbale load in the script, I have the GetFieldSelections in the Table box I am creating,

I tried your solution and again it says that "Field not found - <WorkStatus>" on the load !!!!

Thanks

A

Miguel_Angel_Baeyens

Hi,

I'm missing something here. One thing is the LOAD script and another the charts we discussed in the original post. What do you want to get and where?

Please create a new thread with your issue and post some example application or data to reproduce the issue you are experiencing.

Regards.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica