Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR June 25, 2025: Build on Apache Iceberg with Qlik Open Lakehouse - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
MiRP-276
Contributor II
Contributor II

Support for filters in a Script WHERE statement for a BW SAP query in Qlik Sense for Dates


Hello, good afternoon.

Please help me. I have a BW SAP connection query in Qlik Sense, but when I place it in the Where statement filters, it gives me an error.

The example is as follows:

Let Mes= Num(month(vfecha),'00');
Let Año=Year(vfecha);

SELECT *
FROM /CPMB/QBMW7OX

WHERE  ( [/CPMB/QBDCIYN]=[USD]
       [/CPMB/QBD03VQ]=[$(Año).$(Mes)]
;

It is worth mentioning that the data corresponding to the field in question is the following:

[/CPMB/QBD03VQ] = 2025.05

Does anyone know how to manage this filter in the Where statement?

Thank you very much. Best regards.

Labels (5)
4 Replies
PrashantSangle

I think there is different way to apply where clause in SAP BW / BEX connector. 

It is something like.

[NAME=Z_INT_DEF_OPT_ZROWNBR, SIGN=I, OPTION=BT, LOW=0000000001, HIGH=0000000100]

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MiRP-276
Contributor II
Contributor II
Author

Hello @PrashantSangle thank you very much for your response. The problem is occurring when placing the filter for the dates. I have two dates in two different variables, one for Year and one for Month, because the field has the following value:

LET Año=Year(vfecha);
LET Dia= Day (vfecha);

I am trying to place it in the following way

[/CPMB/QBD03VQ]=[$(Año).$(Mes)]

 

This field brings the following data

Field: [/CPMB/QBD03VQ] 

MiRP276_0-1749222720857.png

I have already tried several ways but none of them work for me since it shows an error.

Does anyone have any idea how to apply it?

 

alexquimu
Partner - Contributor III
Partner - Contributor III

Hey @MiRP-276 ,

 

What version of SAP connector are you using?

 

Did you try using just one variable? So you define previously

Let vAñoMes = $(Año)&'.'&$(Mes)

 

And use that variable to filter. I usually filter BW queries as follows

WHERE ([/CPMB/QBD03VQ]  = $(vAñoMes));

 

Greetings

 

barcd
Contributor II
Contributor II

Hello @alexquimu Thank you very much for your reply, I've already tried it but it still shows an error.

This is the error I'm getting. Does anyone know how I should set it so it doesn't show that error? 

barcd_0-1749479986417.png

Thank you very much.