How to read lines that skip reading lines having Characters of "01" and "25" - substring

Example:
FSA claim 'TO' date of service is 20111201 and the selection date is 20110627
FSA claim 'TO' date of service is 20110702 and the selection date is 20110627
FSA claim 'TO' date of service is 20110725 and the selection date is 20110627
my code is:
else if (line.ToUpper().Contains(" FSA CLAIM 'TO' DATE"))
{
if (!(line.Substring(34, 2).Trim() != "01" & (!(line.Substring(34, 2).Trim() != "25"))))
{
//MyClaimNumber = MyHoldline.Substring(25, 12);
outputFSAClaimtodate.WriteLine(MyHoldline);
outputFSAClaimtodate.WriteLine(line);
it still read those line containing them.
My target out should be like this:
FSA claim 'TO' date of service is 20110702 and the selection date is 20110627
Please help!!!

This condition:
!(line.Substring(34, 2).Trim() != "01" & (!(line.Substring(34, 2).Trim() != "25")))
is confusing. It has, for example:
!(line.Substring(34, 2).Trim() != "25")
or "not (not equals)", which is the same as "equals":
(line.Substring(34, 2).Trim() == "25")
If you mean "neither X nor Y", that's "(not X) and (not Y)":
if (line.Substring(34, 2).Trim() != "01" && line.Substring(34, 2).Trim() != "25")

Related

gtsummary table displaying members of a characteristic I've not included in a filter

I'm probably missing something dumb here but I'm using a filter command to only include certain values in a characteristic. They are still showing in the table but display NA. Is there a way to prevent them from appearing at all?
sample output
gts.fmlh.dc.arrival.triagestart.area = fmlh.dc |>
filter(primary_care_area == "Blue" | primary_care_area == "Green" |primary_care_area == "Red" | primary_care_area == "Yellow" | primary_care_area == "Midtrack" | primary_care_area == "Trauma") |>
select(primary_care_area, arrival_to_triage_start) |>
tbl_continuous(
variable = arrival_to_triage_start,
statistic = ~"Median {median} \n Mean {mean}",
label = list(
primary_care_area ~ "Team",
arrival_to_triage_start ~ "Door to Triage")

Is it possible to count the number of occurrences of a calculated field's result in Tableau?

I have a function that categorizes calls a user has made into 3 categories using this calculation:
IF 0 <= DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE])
AND DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE]) <= 7
THEN "Week After"
ELSEIF -7 <= DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE])
AND DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE]) < 0
THEN "Week Before"
ELSE "Not within a week"
END
I was wondering if it's possible to count the number of occurrences of a particular outcome of the function on a per user basis in order to then categorize each user based off of the number of occurrences. I'm attempting to use this calculation to do so:
IF { FIXED [SUBID]: COUNT([DateDiff Calc] = 'Week After')} = 1
THEN "1 Conference User"
ELSEIF { FIXED [SUBID]: COUNT([DateDiff Calc] = 'Week After') } > 1
THEN "Multiple Conference User"
ELSE "0 Conference User"
END
but the COUNT function I'm using is not working properly it seems. It seems that the COUNT function is also counting occurrences of both "Week Before" and "Not within a week" from the first function.
I think the problem is the measure part of your LOD expression :
COUNT([DateDiff Calc] = 'Week After')
This will just give you count of both times: when your conditions is met and when its not met. [DateDiff Calc] = 'Week After' will return true or false, both will be counted as +1 in the count function.
You could try something like:
IF { FIXED [SUBID]: SUM(IF[DateDiff Calc] = 'Week After' THEN 1 ELSE 0 END)} = 1
THEN "1 Conference User"
...

Trigger value in a other line

ON *:TEXT:*3rd*:*: {
ON *:TEXT:*->*:*: {
if ($nick == Nickname) {
%value = $mid($1-, $calc($pos($1-, 3rd, 1) + 14), $calc($pos($1-, Second, $pos($1-, Second, 0)) - $pos($1-, 3rd, 1) - 23))
}
}
if($nick == Nickname) {
msg $chan $mid($1-, $calc($pos($1-, ->, 1) + 6), $calc($pos($1-, <-, $pos($1-, <-, 0)) - $pos($1-, ->, 1) - 9))
msg $chan %value
}
}
Chatoutput goes like
Nickname: It's the 3rd candy
Nickname: It's the second candy
What i want to do is, if the text 3rd is in the sentence trigger ON *:TEXT:*->*:*: {
and make a %variable of the input of 3rd in %value with the text of 3rd and pass it to the other line.
If not 3rd is in the sentence do nothing.
I hope i'm clearly with what i want it to do hope someone can help me.
first, you cant trigger an event with another
you can mix both in one
an example
on $*:text:/3rd.*->(.+)<-/iS:#:{
if ($nick == Nickname) {
%value = $regml(1)
msg $chan %value
}
}
what this script does is
on $:text:/3rd.->(.+)<-/iS:#:{
will match if "3rd" is on text, and if it is, catches texts that are between -> and <-
/iS i - will match for upper and lower cases
S - will strip any color codes, including bold, italic, and underline
%value = $regml(1) will give to %value the match between -> and <-
if ($nick == Nickname) { will trigger only for an specific Nickname
msg $chan %value will send the match text between -> and <- to channel
if it is not what you're looking for, tell me

Crystal Reports select expert OR statement on CSV

I am using the Select Expert to filter on a combination of 3 fields:
({flatfile_csv.site} = "L" and {flatfile_csv.bursguar} = "1")
or
({flatfile_csv.site} = "L" and {flatfile_csv.bursnorm} = "1")
In this case it only matches:
({flatfile_csv.site} = "L" and {flatfile_csv.bursguar} = "1")
If I swap the statements around:
({flatfile_csv.site} = "L" and {flatfile_csv.bursnorm} = "1")
or
({flatfile_csv.site} = "L" and {flatfile_csv.bursguar} = "1")
Then it only handles
({flatfile_csv.site} = "L" and {flatfile_csv.bursnorm} = "1")
It seems to completely ignore the second part of the OR statement. Any idea how to implement an OR in CR?
I've never used CR with a CSV file before, so I don't know how it's handling those empty strings. Try setting the selection formula to "Default Values for Nulls" instead of "Exception for Nulls" with this:
{flatfile_csv.site} = "L"
and
(
{flatfile_csv.burnsnorm}="1"
or {flatfile_csv.burnsguar}="1"
)

Filtering in SSRS

I'm trying to filter my parameters in a condition where I have it choose a record when a multiple selection ListBox is selected. If a person doesn't select a record it by default chooses the "Not Selected" option. The issue is:
=IIF(
InStr(Join(Parameters!ProvinceID.Value,”,”),0),
True,
IIF(
InStr(Join(Parameters!ProvinceID.Value,”,”),
Fields!ProvinceID.Value
)<>0,
True,
False)
)
The result wont allow the Proper filter.
InStr(Join(Parameters!ProvinceID.Value,”,”),0)
Shouldn't that 0 be "0"
Try:
=IIf(
InStr(Join(Parameters!ProvinceID.Value, ", "), "0") > 0
,True
,IIf(
InStr(Join(Parameters!ProvinceID.Value, ", "), Fields!ProvinceID.Value) > 0,
,True
,False
)
)
InStr will return an integer value of the position where the string searched for starts (if found). Therefore your boolean tests (1st argument of the IIf() function) need to determine if a number equal to or greater than 1 has been returned.
As you are searching for a string, the 0 being searched for in the string must be coded as "0".
If Fields!ProvinceID.Value returns an integer, then it too must be converted to a string using the CStr() function like so:
=IIf(
InStr(Join(Parameters!ProvinceID.Value, ", "), "0") > 0
,True
,IIf(
InStr(Join(Parameters!ProvinceID.Value, ", "), CStr(Fields!ProvinceID.Value)) > 0,
,True
,False
)
)
What are you comparing to? Usually the IIF needs something like =IIF(Fields!ListBox1.Value = "value", "option1", "option2")
=IIF(Fields!Eyes.Value = "Green", "Green", "Other Colour")