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: 
Daniel77
Creator
Creator

Copy value of dimension to other records when matching PO number

Hi There,

 

I have the following issue shown in the image below

Daniel77_0-1687866957946.png

In the script or table i would like to copy the errorMsg to all lines where the Purchase Order Number matches.

I am struggling with getting a peek function working but i think this is the best approach. Can anyone assist please?

Thank you

 

 

Labels (3)
1 Solution

Accepted Solutions
Zapparoli
Creator II
Creator II

Hi @Daniel77 !

Did some testing and managed to achieve it using Peek() Function, see Example:

Matheus_Zapparoli_0-1687871636355.png

If(len(ErrorMsg)<1, Peek(ErrorMsg),ErrorMsg) as ErrorMsg,

Here I used "Len" to find out if the value is empty (Since it's not Null in your case), and after that used Peek in the "ErrorMsg" Field, and here is the result:

Matheus_Zapparoli_1-1687871723600.png

Can you try this and let me know if it helped ?

-Zapparoli

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

View solution in original post

4 Replies
Zapparoli
Creator II
Creator II

Hi @Daniel77 !

Did some testing and managed to achieve it using Peek() Function, see Example:

Matheus_Zapparoli_0-1687871636355.png

If(len(ErrorMsg)<1, Peek(ErrorMsg),ErrorMsg) as ErrorMsg,

Here I used "Len" to find out if the value is empty (Since it's not Null in your case), and after that used Peek in the "ErrorMsg" Field, and here is the result:

Matheus_Zapparoli_1-1687871723600.png

Can you try this and let me know if it helped ?

-Zapparoli

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

Daniel77
Creator
Creator
Author

Thanks so much for the reply Zapparoli,

I actuall managed to resolve this with the following:

 

If( Len(Trim(ErrorMsg)),ErrorMsg, Peek(ErrorMsg2) ) as ErrorMsg2,

But your method worked too. thank you, I'll mark yours as the solution, thankyou

379SSS
Contributor III
Contributor III

Hi @Daniel77 

You can try using "IF" statement to achieve that
If(len(Purchase Order Number)>1 and isnull(errorMsg), 'itemref1not find. ', errorMsg)

Daniel77
Creator
Creator
Author

Thanks,

That's another good option but i will be unsure of the errors at the point of load and new ones would need a change to the load script.

 

I appreciate your comment, thank you

 

Daniel